/*=============================================================================
#    The element-comm is a tentative program used to test our ideas.           
#                       Copyright (C)  bgao                                    
#
#     This program is free software; you can redistribute it and/or            
#      modify it under the terms of the GNU General Public License             
#     as published by the Free Software Foundation; either version 2           
#         of the License, or (at your option) any later version.               
#
#     This program is distributed in the hope that it will be useful,          
#    but WITHOUT ANY WARRANTY; without even the implied warranty of           
#     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the            
#             GNU General Public License for more details.                    
#
#    You should have received a copy of the GNU General Public License        
#     along with this program; if not, write to the Free Software             
#      Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,             
#                       MA  02110-1301, USA.                                  
#==============================================================================
# $Id$ 
#
# $Author$ 
#
# $Revision$ 
#
# $Date$ 
#
# Description: 
#
=============================================================================*/
#ifndef __WSN_RF_H
#define __WSN_RF_H

#include "cc2420_rf.h"
#include "wsn-cpu.h"

int8 rf_init(void);
int8 rf_reset(void);

int8 rf_on(void);
int8 rf_off(void);

int8 rf_osc_on(void);
int8 rf_osc_off(void);

uint8 rf_tx_on(void);
bool rf_tx_cca_on(void);

int8 rf_write_tx_fifo(uint8 *buf, uint8 len);
int8 rf_read_rx_fifo(uint8 *buf, uint8 len);
int8 rf_flush_tx_fifo(void);
int8 rf_flush_rx_fifo(void);

uint16 rf_set_short_addr(uint16 short_addr);
uint16 rf_get_short_addr(void);
uint16 rf_set_pan_id(uint16 pan_id);
uint16 rf_get_pan_id(void);
uint64 rf_set_ieee_addr(uint64 ieee_addr);
uint64 rf_get_ieee_addr(void);


int8 rf_rx_on(void);
int8 rf_rxtx_off(void);

int8 rf_ed_scan(void);

int8  rf_set_chnl(uint8 chnl);


int8 rf_enable_addr_recg(void);
int8 rf_disable_addr_recg(void);

int8 rf_set_pan_coord(void);
int8 rf_clr_pan_coord(void);


int8 rf_tx_ack(void);
int8 rf_tx_ack_pend(void);


int8 rf_set_tx_power(uint8 pa_level);
int8 rf_get_rx_power(void);

int8 rf_set_rx_threshold(uint8 thr_value);

uint8 rf_get_rand(void);

#endif


